#!/bin/bash
read -p "输入文件名称可以为点则是全部"  file_name
if git add $file_name
then
        echo "暂存区添加成功"
else
        echo "添加失败"
        exit
        #return 100

read -p "输入尾部的标识符"  tag
fi


if git commit -a -m $(date +%Y/%m/%d--%H:%M:%S)"$tag" #git  -a  -m $(date +%Y/%m/%d--%H:%M:%S)"$tag"
then
        echo "提交成功"
else
        echo "提交失败"

fi


git pull --rebase origin master
if [ $? -eq 0  ]
then
        echo "拉取成功"
        git push origin master
        if [ $? -eq 0 ]
        then
                echo "上传成功"
        else
                echo "上传失败"
        fi
else
        echo "拉取失败"
fi

